<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<body>
<style>
    .buy{
     color: #1cad70;
    }
    .sell{
     color: red;
    }
</style>


<table class="ui-table">
    <thead>
    <tr>
        <th>序号</th>
        <th>用户id</th>
        <th>用户</th>
        <th>类别</th>
        <th>物品</th>
        <th>价格</th>
        <th>交易总数</th>
        <th>剩余数</th>
        <th>创建时间</th>
        <th>状态</th>
    </tr>
    </thead>

    <tbody>
    <tr th:each="info,infoStat : ${page.list}" >
        <td th:text="${infoStat.index}"></td>
        <td th:text="${info.userId}"></td>
        <td th:text="${info.userName}"></td>
        <td  th:class= "${info.type == 1?'buy':'sell'}" th:text="${info.type ==1}?'买':'卖'"></td>
        <td th:text="${info.goodName}"></td>
        <td th:text="${info.price}"></td>
        <td th:text="${info.initialAmount}"></td>
        <td style="color: #f59b00" th:if="${info.status == 0}" th:text="${info.amount}"></td>
        <td th:text="${#dates.format(info.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>
        <td th:if="${info.status == 0}" >
            <a style="color:orange"  >进行中
            </a>
        </td>
        <td th:if="${info.status == 1}" >
            <a style="color: #2a80eb"    th:onclick="|checkbaojia('${info.id}')|" >已完成交易</a>
        </td>

    </tr>
    </tbody>
</table>
<!-- 底部分页 -->
<!-- 底部分页 -->
<form id="form" style="display: flex;justify-content: center">
    当前页  （<a  th:text="${page.currentPage+1}"  />）
    <a onclick="loadPage('/trade/list', - 1)" th:if="${page.currentPage > 0}">上一页</a>
    <a onclick="loadPage('/trade/list',1)" th:if = "${page.currentPage < (page.totalPage - 1)}">下一页</a>
    共      <a style="color: #2a80eb"  th:text="${page.total}" />条|
    <a style="color: #2a80eb"  th:text="${page.totalPage}" />页
    每页    <a style="color: #f59b00"  th:text="${page.pageSize}" />条

    <input type="hidden" name="pageSize" th:value="${page.pageSize}" />
    <input name="currentPage" id="currentPage" type="hidden" th:value="${page.currentPage}"  />
    <input name="flag" id="flag" type="hidden" value="0"   />
</form>



</body>
<head>
    <meta charset="UTF-8">
    <title>交易列表</title>
</head>
</html>